public class codePointTest {
    public static void main(String[] args) {
        String chaCha = "h𝕆";
        System.out.println("原始字符串");
        System.out.println(chaCha);
        System.out.println("--------------");
        int len = chaCha.length();
        System.out.println("代码单元数量:"+len);
        for (int i = 0; i < len; i++) {
            char charAt = chaCha.charAt(i);
            System.out.println(Integer.toHexString(charAt));
        }
//        所以通过charAt获得的可能不是某个字符，而是辅助字符的一个代码单元。

        System.out.println("--------------");
        int codePointCount = chaCha.codePointCount(0,len);
        System.out.println("码点数量:"+codePointCount);
        for (int i = 0; i < codePointCount; i++) {
            int index = chaCha.offsetByCodePoints(0,i);
            int chaAt = chaCha.codePointAt(index);
            System.out.println(Integer.toHexString(chaAt));

        }
    }


}
